#import "CharacountForNotes8.h"

%hook NotesDisplayController

- (void)viewWillAppear:(BOOL)arg1 // Initialize title
{
	NSLog(@"Hello");
	%orig;
	NSString *content = self.note.contentAsPlainText;
	NSString *contentLength = [NSString stringWithFormat:@"共%lu字符",(unsigned long)[content length]];
	self.title = contentLength;
}
- (void)viewDidDisappear:(BOOL)arg1 // Reset title
{
	NSLog(@"Hello");
	%orig;
	self.title = nil;
}
- (void)noteContentLayerContentDidChange:(NoteContentLayer *)arg1 updatedTitle:(BOOL)arg2
{
	NSLog(@"Hello");
	%orig;
	NSString *content = self.contentLayer.textView.text;
	NSString *contentLength = [NSString stringWithFormat:@"共%lu字符",(unsigned long) [content length]];
	self.title = contentLength;
}
%end